public class Duck {
    private String color;
    private double heavy;
    // 父类构造方法：初始化颜色和重量
    public Duck(String color, double heavy) {
        this.color = color;
        this.heavy = heavy;
    }
    // 父类fly()方法：基础实现
    public void fly() {
        System.out.println("鸭子会飞行");
    }
    // 父类quack()方法：基础实现
    public void quack() {
        System.out.println("鸭子会嘎嘎叫");
    }
    // 重载setHeavy()：接收double类型重量
    public void setHeavy(double heavy) {
        this.heavy = heavy;
    }
    // getter方法：获取属性值
    public String getColor() {
        return color;
    }
    public double getHeavy() {
        return heavy;
    }
}